<!--# layout("/common/layout.html",{"jsBase":"/js/cms/telentCard/"}){ -->
<!--# if(talentCardList.~size==0){ -->
<div style="margin-top: 100px;text-align: center;"><h3>暂无人才卡片信息</h3></div>
<!--# } -->
<!--# for(tc in talentCardList){ -->
<div class="cardList" cardId="${tcLP.index}">
    <div class="imgRegion" style="background:url('${ctxPath}/js/telentCard-bg.jpg') no-repeat ;
        background-size:600px 378px;width:600px; height:250px;padding-top: 148px; ">

        <div class="layui-row" style="margin-left:372px;
            color: white;
            font-size: 18px;">
            姓名：${tc.name}
        </div>
        <div class="layui-row" style="margin-left:40px;margin-top: 25px;
            color: white;
            font-size: 18px;
            width:290px;
            float: left;">
            证件号：${tc.cardNumber}
        </div>

        <div class="layui-row" style="margin-left:40px;margin-top: 25px;width:100px;float: left;
            color: white;
            font-size: 18px;">
            <!--#
            var a = tc.gender;
            var b;
            if(a=="0"){
                b = "保密";
            }else if(a=="1"){
                b = "男";
            }else if(a=="2"){
                b = "女";
            }
            -->
            性别：${b}
        </div>

        <div class="layui-row" style="margin-left:40px;margin-top: 20px;width:100%;float: left;
            color: white;
            font-size: 18px;">
            人才卡编号：${tc.seq}
        </div>

        <div class="layui-row" style="margin-left:40px;margin-top: 20px;width:300px;float: left;
            color: white;
            font-size: 18px;">
            有效期限：${tc.startdate, "yyyy-MM-dd"} - ${tc.enddate, "yyyy-MM-dd"}
        </div>

        <div class="layui-row" style="margin-left:33px;margin-top: 20px;float: left;
            color: white;
            font-size: 18px; ">
            累计积分：${tc.score}
        </div>

        <div class="layui-row" style="position: relative;
            top: -123px;
            left: 486px;
            font-size: 120px;
            color: white;">
            ${tc.level}
        </div>

    </div>

    <div style="margin-left: 270px;margin-bottom: 10px;">
        <a id="downBtn-${tcLP.index}" href="" download="人才卡.jpg" class="layui-btn">保存到本地</a>
    </div>
</div>
<!--# } -->

<!--#} -->
<script type="text/javascript" src="${ctxPath}/js/html2canvas.min.js?v=${jsVer}"></script>
<script type="text/javascript">
    $(".cardList").each(function(){
        var cardId = $(this).attr("cardId");
        html2canvas($(this).children(".imgRegion")[0]).then(function(canvas){
        //页面加载完生成自动将页面转为图片
            var imgUri = canvas.toDataURL();
            $("#downBtn-"+cardId).attr('href',imgUri);
        });
    });


    $(document).ready(function(){
        $(".sex").each(function (a,b) {
           var sex = $(this).text();
        })

    });

</script>
